package com.tjp.oss.adapter;

import com.tjp.oss.entity.FileInfo;
import org.springframework.web.multipart.MultipartFile;


import java.io.InputStream;
import java.util.List;

/**
 * @program: jz-club
 * @description: 文件主适配器
 * @author: aaronTang
 * @create: 2024-03-07
 */
public interface StorangeAdapter {
    /**
     * 创建bucket
     */
    public void createBucket(String bucket);

    /**
     * 获取所有桶
     */
    public List<String> getAllButket();

    /**
     * 获取当前桶和文件
     */
    public List<FileInfo> getAllFile(String bucket);

    /**
     * 上传文件
     */
    public void uploadFile(MultipartFile uploadFile, String bucket, String objectName);


    /**
     * 下载文件
     */
    public InputStream downloadFile(String bucketName, String objectName);


    /**
     * 删除桶
     */
    public void deleteBucketObject(String bucketName, String objectName);
}
